To install MyBB using the docker method, you have to download docker first.
On Arch Linux, you can use the following command for this:
sudo pacman -Syu docker-desktop
Hint: use the
dockerfor a headless server.docker-desktopis for systems with a GUI.
Now build the following folder structure where you want to install MyBB to: (get the files from https://github.com/mybb/docker)
/opt/mybb/
stack.yml
mybb/
postgres/
data/
nginx/
default.conf
You might want to increase the maximum request length in the nginx/default.conf file now:
Add client_max_body_size 1000M; (for 1GB) into the server directive.
Change the owner of the created folder and all subdirectories / files to the current user:
sudo chown <user>:<user> /opt/mybb --recursive
If you are on Docker Desktop (the GUI), allow sharing from the /opt/mybb folder by going to:
Settings -> Resources -> File sharing -> Virtual file shares and add the directory /opt/mybb. Click on Apply & Restart afterwards.
Change the POSTGRES_PASSWORD inside the /opt/mybb/stack.yml to something secure. This will be your database password.
Prepare Docker swarm:
docker swarm init
Note: Our host will be added automatically to the Swarm.
Change to the folder /opt/mybb:
cd /opt/mybb
Deploy the software bundle:
docker stack deploy --compose-file stack.yml mybb
You should now see the following output:
Creating network mybb_default
Creating service mybb_postgresql
Creating service mybb_mybb
Creating service mybb_nginx
You can check if the services are created correctly by using this command as well:
docker service ls
The REPLICAS should be 1/1. If it is 0/1, an error occured and the container died or never spawned.
These errors usually occur because the file shares are not possible. Either the folders do not exist or Docker is not permitted to share them to the container.
Get the logs of each service by using these commands:
docker service logs -f mybb_mybbdocker service logs -f mybb_nginxdocker service logs -f mybb_postgresqlIf you want to stop and delete all services from docker:
docker service rm mybb_mybb mybb_nginx mybb_postgresql
Note: Even though when removing the services, the data still persists inside
/opt/mybb.
If everything worked, we can proceed to the setup now!
Go to localhost:8080
Continue until the Database Configuration screen. There, enter the info from the /opt/mybb/stack.yml.
Here are the values you have to fill in:
PostgreSQLmybb_postgresqlmybb<your_password>mybbContinue until the Board Configuration.
Here, configure everything to your liking, and you will be ready to go.